package Data;
import java.util.*;
/**
 *
 * @author Justin
 */
public class ReturnRentalBO  {
    
    private String id;
    private Date DateIn;
    protected boolean alreadyInDB=false;
    protected boolean dirty =true;
    
    /** Creates a new instance of ReturnRentalBO */
    public ReturnRentalBO(String id) {
        this.setId(id);
    }
    
    public String getId() {       //gets the id of the ReturnRentalBO
        return id;
    }
    
    public void setId(String id) {     //sets the id of the ReturnRentalBO
        this.id = id;
    }
    
    public Date getDateIn() {            //gets the date the rental was returned
        return DateIn;
    }
    
    public void setDateIn(Date DateIn) {        //sets the date the rental was returned
        this.DateIn = DateIn;
    }
    public int CalculateDaysLate(){             //finds how many days late the rental was
        int latedays = 0;
        Calendar c = Calendar.getInstance();
        c.setTime(DateIn);
        Calendar p = Calendar.getInstance();
        //p.setTime(DateOut);  from the RentalBO
        c.compareTo(p);                                //compare date in with date due,
        //figure out if it is late,
        //calculate # of days late
        //LateFeeBO get's late days from here'
        //Calendar c = Calendar.getInstance();
        //c.setTime(DateOut);
        //c.add(c.DAY_OF_MONTH, DaysToRent);
        //DateDue = c.getTime();
        return latedays;
    }
    
    /** Gets the revenueSource isAlreadyInDB variable */
    public boolean isAlreadyInDB() {
        return alreadyInDB;
    }
    
    /** Sets the revenueSource isAlreadyInDB variable*/
    public void setAlreadyInDB(boolean alreadyInDB) {
        this.alreadyInDB = alreadyInDB;
    }
    
    /** Gets the revenueSource dirty variable */
    public boolean isDirty() {
        return dirty;
    }
    
    /** Sets the revenueSource dirty variable */
    public void setDirty(boolean dirty) {
        this.dirty = dirty;
    }
    
    
}
